package tests.sorter;

import static org.junit.Assert.*;

import org.junit.*;

import sorter.Sorter;
import tests.TestUtil;

public class SorterTest {
	Sorter sort;
	StringBuilder sb;

	@Before
	public void Setup() {
		sort = new Sorter();
		sb = new StringBuilder();
	}

	@Test
	public void testproduceResultGeneratesCorrectFileOutput() {
		sort.produceResult("testFiles/sorterTestFiles/startFile.txt",
				"testFiles/sorterTestFiles/finnisFile.txt",
				"testFiles/sorterTestFiles/resultFile.txt");
		String resultFile = TestUtil
				.readFile("testFiles/sorterTestFiles/resultFile.txt");
		assertEquals(
				"StartNr; Totaltid; Starttid; Måltid\n1; 1.23.34; 12.00.00; 13.23.34\n",
				resultFile);
	}

}
